
use BGT_2007_2010_2012_withvars_021716_mechanisms.dta, clear

qui run globals.do

/* Figure 2 */
/* Relationship between Changes in Labor Market Slack and Employer Requirements By State and Occupation */

*local restric= "& dBGT>=-2 & dBGT<=0"
binscatter d$educ du $weight $restric `restric', controls(i.year) absorb(occyear) nquantiles(50) ///
ytitle("P.P. Change in Share of Postings Req. Bachelor's/Graduate Deg.", size(small)) ///
xtitle("P.P. Change in Labor Supply/Demand Ratio", size(small)) name(one, replace)
graph export fig5a.eps, replace

*local restric= "& dBGT>=-2 & dBGT<=0"
binscatter d$exper du $weight $restric`restric', controls(i.year) absorb(occyear) nquantiles(50) ///
ytitle("PP. Change in Share of Postings Req. >=4 Yrs Experience", size(small)) ///
xtitle("P.P. Change in Labor Supply/Demand Ratio", size(small)) name(two, replace)
graph export fig5b.eps, replace

*local restric= "& dur<=0 & dur>=-4"
binscatter d$educ du $weight $restric `restric', controls(i.year) absorb(occyear) nquantiles(25) ///
ytitle("P.P. Change in Share of Postings Req. Bachelor's/Graduate Deg.", size(small)) ///
xtitle("P.P. Change in Unemployment Rate", size(small))  name(three, replace)
graph export fig5c.eps, replace

*local restric= "& dur<=0 & dur>=-4"
binscatter d$exper du $weight $restric `restric', controls(i.year) absorb(occyear) nquantiles(25) ///
 ytitle("PP. Change in Share of Postings Req. >=4 Yrs Experience", size(small)) ///
 xtitle("P.P. Change in Unemployment Rate", size(small))  name(four, replace)
graph export fig5d.eps, replace
 


********************************************************************************

#delimit ;
binscatter dneed4 ldvet_bp if vetshare_vsoe<.2 & (strpos(occsoc_name,"Mani")>0| strpos(occsoc_name,"Hair") >0 ),  controls(statefip year)
ytitle("PP Change in Share of Postings Req. >=4 Yrs Experience") xtitle("Log Change in Veterans by Place of Birth") /*subtitle("Hairdressers and Manicurists")*/ legend(off);
graph export vet_placebo_a.eps, replace ;

binscatter dneed4 ldvet_bp if vetshare_vsoe>14 & (strpos(occsoc_name,"Avio")>0| strpos(occsoc_name,"Pilot") >0),  controls(statefip year)
ytitle("PP Change in Share of Postings Req. >=4 Yrs Experience") xtitle("Log Change in Veterans by Place of Birth") /*subtitle("Pilots and Avionics Techs")*/ legend(off);
graph export vet_placebo_b.eps, replace ;



********************************************************************************

/*FIGURE 5: Relationship between Measures of Veteran and Civilian Concentration Across Occupations*/

/*FIGURE 6: Relationship between Measures of Veteran Concentration Withing and Across Occupations*/

use acs3yr_2005to2007_veteran_employment_shares.dta, clear
keep occsocACS occsocorig vetshare_vsoe vetshare_osve civilian_share occsoc_name
duplicates drop occsocorig, force

graph twoway (lfit vetshare_osve civilian_share, lcolor(black))  (scatter vetshare_osve civilian_share, mcolor(black) msize(small) ), ///
xtitle("Occupation Share of Civilian Labor Force", size(small)) ///
ytitle("Occupation Share of Veteran Labor Force", size(small)) ///
legend(off)  plotregion(fcolor(white)) graphregion(fcolor(white))

replace occsoc_name="Bailiffs and Correctional Officers" if occsocorig=="333010"
replace occsoc_name="Engineering Technicians" if occsocorig=="173020"
replace occsoc_name="Police Officers and Sherrifs" if occsocorig=="333050"
replace occsoc_name="Security Guards" if occsocorig=="339030"

gen occnm=occsoc_name if inlist(occsocorig, "131081", "151151", "173020", "332011", "333010", "333050", "339030", "493011")
*vetshare_osve>1 | vetshare_vsoe>10

graph twoway (scatter vetshare_osve civilian_share, mcolor(navy) msymbol(smcircle) mlabel(occnm) mlabcolor(black) mlabsize(vsmall) ), ///
xtitle("Occupation Share of Civilian Labor Force", size(small)) ///
ytitle("Occupation Share of Veteran Labor Force", size(small)) ///
legend(off)  plotregion(fcolor(white)) graphregion(fcolor(white) lcolor(gs15))  graphregion(fcolor(white)) xsize(5) ysize(5) 
graph export $pathUPS/output/figures/figure5.eps, replace
